In [1]:
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
In [2]:
starting_date = '20160701'
sample_numpy_data = np.array(np.arange(24)).reshape((6,4))
dates_index = pd.date_range(starting_date, periods=6)
sample_df = pd.DataFrame(sample_numpy_data, index=dates_index, columns=list('ABCD'))
sample_df
Out[2]:
In [3]:
sample_df_2 = sample_df.copy()
sample_df_2['Fruits'] = ['apple', 'orange','banana','strawberry','blueberry','pineapple']
sample_df_2
Out[3]:
Setting a new column automatically aligns the data by the indexes
In [ ]:
In [ ]:
In [ ]:
In [ ]:
documentation: http://pandas.pydata.org/pandas-docs/stable/generated/pandas.DataFrame.iat.html
iat provides integer based lookups
In [ ]:
In [ ]:
In [ ]: